package com.wyw.learning.config;//package com.wyw.learning.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.annotation.Order;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.core.userdetails.User;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.provisioning.InMemoryUserDetailsManager;
//import org.springframework.security.web.SecurityFilterChain;
//
//import static org.springframework.security.config.Customizer.withDefaults;
//
///**
// * @Title
// * @Description
// * @Author Mr Wu yewen.wu.china@gmail.com
// * @Date 2023/9/18 10:49
// * Update History:
// * Author        Time            Content
// */
//@Configuration
//@EnableWebSecurity
//public class DefaultSecurityConfig {
//
//    // @formatter:off
//    @Bean
//    @Order(2)
//    SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception {
//        http
//                .authorizeRequests(authorizeRequests ->
//                        authorizeRequests.anyRequest().authenticated()
//                )
//                .formLogin(withDefaults());
//
//
////        http
////                .authorizeHttpRequests()
////                .antMatchers("/assets/**", "/webjars/**", "/login").permitAll()
////                .anyRequest().authenticated()
////                .and()
////
////                .formLogin(formLogin ->
////                        formLogin
////                                .loginPage("/login")
////                );
//
//        return http.build();
//    }
//    // @formatter:on
//
//    // @formatter:off
//    @Bean
//    UserDetailsService users() {
//        UserDetails user = User.withDefaultPasswordEncoder()
//                .username("user")
//                .password("password")
//                .roles("USER")
//                .build();
//        return new InMemoryUserDetailsManager(user);
//    }
//    // @formatter:on
//
//}
//
